import { defineComponent, useSlots, resolveComponent, openBlock, createBlock, mergeProps, isRef, withCtx, renderSlot, createElementVNode, createVNode, createCommentVNode, createTextVNode } from "vue";
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
var _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const _hoisted_1 = { class: "dialog-footer" };
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u786E \u5B9A");
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u53D6 \u6D88");
const _sfc_main = /* @__PURE__ */ defineComponent({
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    confirmLoading: {
      type: Boolean,
      default: false
    },
    closeOnClickModal: {
      type: Boolean,
      default: false
    },
    customClass: {
      type: String,
      default: "bs-dialog"
    }
  },
  emits: ["update:dialogVisible", "confirm"],
  setup(__props, { emit }) {
    useSlots();
    const close = () => {
      emit("update:dialogVisible", false);
    };
    const confirm = () => {
      emit("confirm");
    };
    return (_ctx, _cache) => {
      const _component_el_button = resolveComponent("el-button");
      const _component_el_dialog = resolveComponent("el-dialog");
      return openBlock(), createBlock(_component_el_dialog, mergeProps({
        modelValue: __props.dialogVisible,
        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(dialogVisible) ? dialogVisible.value = $event : null),
        "custom-class": __props.customClass,
        "close-on-click-modal": __props.closeOnClickModal
      }, _ctx.$attrs), {
        footer: withCtx(() => [
          __props.customClass !== "dialogNoFooter" ? renderSlot(_ctx.$slots, "footer", { key: 0 }, () => [
            createElementVNode("div", _hoisted_1, [
              createVNode(_component_el_button, {
                type: "primary",
                disabled: __props.confirmLoading,
                onClick: confirm
              }, {
                default: withCtx(() => [
                  _hoisted_2
                ]),
                _: 1
              }, 8, ["disabled"]),
              createVNode(_component_el_button, {
                disabled: __props.confirmLoading,
                onClick: close
              }, {
                default: withCtx(() => [
                  _hoisted_3
                ]),
                _: 1
              }, 8, ["disabled"])
            ])
          ], true) : createCommentVNode("", true)
        ]),
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default", {}, void 0, true)
        ]),
        _: 3
      }, 16, ["modelValue", "custom-class", "close-on-click-modal"]);
    };
  }
});
var dialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9e537d7c"]]);
var index = {
  install(app) {
    app.component("bs-dialog", dialog);
  }
};
export { index as default };
